package mybatis.entity;

import cn.hutool.core.util.StrUtil;
import org.springframework.util.StringUtils;

/**
 * @author dogger
 * 2021-10-15 18:08
 */
public class GenEntity {
    /**
     * 数据库路径
     */
    private String url;

    /**
     * 数据库用户名
     */
    private String userName;

    /**
     * 数据库密码
     */
    private String password;

    /**
     * 文件输出根目录
     */
    private String outputDir;

    /**
     * 包路径
     *  (总路径=文件输出根目录+包路径)
     */
    private String parentPackage;

    /**
     * 表名
     */
    private String[] tables;

    /**
     * 模板路径
     */
    private String templatePath;


    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getOutputDir() {
        return outputDir;
    }

    public void setOutputDir(String outputDir) {
        this.outputDir = outputDir;
    }

    public String getParentPackage() {
        return parentPackage;
    }

    public void setParentPackage(String parentPackage) {
        this.parentPackage = parentPackage;
    }

    public String[] getTables() {
        return tables;
    }

    public void setTables(String[] tables) {
        this.tables = tables;
    }

    public String getTemplatePath() {
        if(StrUtil.isBlank(templatePath)){
            templatePath = "/template/basic";
        }
        return templatePath;
    }

    public void setTemplatePath(String templatePath) {
        this.templatePath = templatePath;
    }


}
